import numpy as np

from ultralytics import YOLO


model = YOLO("best.pt")

results = model("D:/data/train/Gouqizi/GouqiziGouqizi22.jpg",show=True)
names_dict = results[0].names
probs = results[0].probs.data.tolist()

print(names_dict)
print(probs)
print(names_dict[np.argmax(probs)])

# results = model.predict("D:\BaiduNetdiskDownload\data\train\Gouqizi\GouqiziGouqizi22.jpg",show=True)